]> dgit.raspbian.org Git - dovecot.git/commit
[PATCH 14/14] lib-mail: Limit total MIME parameter count per message to 200 000
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Fri, 17 Apr 2026 13:57:24 +0000 (15:57 +0200)
committerNoah Meyerhans <noahm@debian.org>
Wed, 16 Sep 2026 19:06:35 +0000 (15:06 -0400)
commit2f1b54334c4c49c9ed6036b25e53a08d3cc11db0
treeef1dfcc126a73dc27ca37133b11cbf1023b5b6fa
parenta5df978bb0e258b0bde97f07daa77a08e106bf1a
[PATCH 14/14] lib-mail: Limit total MIME parameter count per message to 200 000

Content-Type and Content-Disposition parameters are both parsed through
parse_mime_parameters().  A message with many MIME parts each having many
parameters can accumulate millions of struct message_part_param entries.

Add remaining_mime_params to struct message_part_data_limits (combined
budget for both Content-Type and Content-Disposition), initialised to
MESSAGE_PART_DATA_MAX_TOTAL_MIME_PARAMS (200 000).  Cap params_count to the
remaining budget before allocating and deduct accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Gbp-Pq: Name 0014-lib-mail-Limit-total-MIME-parameter-count-per-messag.patch
src/lib-mail/message-part-data.c
src/lib-mail/message-part-data.h